# mcp_client_fast.py
import asyncio
from fastmcp import Client


async def main():
    async with Client("http://127.0.0.1:9000/mcp") as client:
        # 列出工具
        tools = await client.list_tools()
        print("tools:", tools)

        # 调用 read_pdf
        res = await client.call_tool("read_pdf", {"path": "E:/newGit/llm-mas-shu/projects/2.mas/example.pdf", "max_pages": 1})
        print("read_pdf result:", res)

        # 调用 weather
        w = await client.call_tool("weather", {"location": "Shanghai"})
        print("weather:", w)

if __name__ == "__main__":
    asyncio.run(main())